<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
		"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

	<title>Test Dijit Internal Event: "ondijitclick"</title>

	<script type="text/javascript" src="../../dojo/dojo.js" djConfig="isDebug: true, parseOnLoad: true"></script>
	<script type="text/javascript">
		dojo.require("dijit._Widget");
		dojo.require("dojo.parser");

		dojo.declare("dijit.WidgetWithOndijitclick",
			dijit._Widget,
			{
				clickCount: 0,
				onClick: function(){
				},
				_onClick: function() {
					console.log(this.id + ": ondijitclick");
					this.onClick();
				},
				postCreate: function() {
					this.connect(this.domNode, "ondijitclick", "_onClick");
				}
			}
		);
	</script>
	<style>
		div {
			border: 1px solid blue;
			margin-top: 1em;
		}
	</style>
</head>
<body class="tundra">
	<h1>_Widget.ondijitclick test</h1>
	<p>
		This tests dijit's infrastructure for catching SPACE and ENTER key clicks on nodes
		that aren't &lt;button&gt; or &lt;a&gt;, and therefore don't normally respond to keyboard
		"click events".
	</p>
	<p>
		Clicking the first widget moves focus to the plain button,
		but that button itself shouldn't get a click event.   (There are some subtleties about
		whether catch clicks on key-down or key-up so this tests to make sure we are doing
		the right one.)
	</p>
	<div id="first" dojoType="dijit.WidgetWithOndijitclick" tabIndex=0
			onClick="dojo.byId('plainbutton').focus();">
		click me using space or enter, to focus button below
	</div>
	<button id="plainbutton" onclick="console.log('plain button clicked'); window.clicked = true;">plain button</button>
	
	<div id="second" dojoType="dijit.WidgetWithOndijitclick" tabIndex=0
			onClick="dojo.byId('textarea').focus();">
		click me using space or enter, to focus textarea below
	</div>
	<textarea id="textarea">hello world</textarea>

</body>
</html>
